﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.oracle
{
	// Token: 0x02000138 RID: 312
	public class TPlsqlCreateTrigger : TCommonStoredProcedureSqlStatement
	{
		// Token: 0x06000A36 RID: 2614 RVA: 0x00304AB9 File Offset: 0x00302CB9
		public TPlsqlCreateTrigger(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstplsql_createtrigger;
		}

		// Token: 0x06000A37 RID: 2615 RVA: 0x00304ACA File Offset: 0x00302CCA
		internal override void buildsql()
		{
		}

		// Token: 0x06000A38 RID: 2616 RVA: 0x00304ACC File Offset: 0x00302CCC
		internal override void clear()
		{
		}

		// Token: 0x06000A39 RID: 2617 RVA: 0x00304ACE File Offset: 0x00302CCE
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000A3A RID: 2618 RVA: 0x00304AD5 File Offset: 0x00302CD5
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x170001DB RID: 475
		// (get) Token: 0x06000A3B RID: 2619 RVA: 0x00304AD7 File Offset: 0x00302CD7
		public override TObjectName StoredProcedureName
		{
			get
			{
				return this.triggerName;
			}
		}

		// Token: 0x06000A3C RID: 2620 RVA: 0x00304AE0 File Offset: 0x00302CE0
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			if (base.doParseStatement(psql) != 0)
			{
				return -1;
			}
			TCreateTriggerSqlNode tcreateTriggerSqlNode = (TCreateTriggerSqlNode)this.rootNode;
			this.triggerName = tcreateTriggerSqlNode.TriggerName;
			base.DatabaseObjects.Add(this.triggerName);
			tcreateTriggerSqlNode.Trigger_event_clause.doParse(this, ESqlClause.unknown);
			this.eventClause = tcreateTriggerSqlNode.Trigger_event_clause;
			if (tcreateTriggerSqlNode.WhenCondition != null)
			{
				tcreateTriggerSqlNode.WhenCondition.doParse(this, ESqlClause.unknown);
				this.whenCondition = tcreateTriggerSqlNode.WhenCondition;
			}
			this.followsTriggerList = tcreateTriggerSqlNode.FollowsTriggerList;
			tcreateTriggerSqlNode.Stmt.doParse(this, ESqlClause.unknown);
			this.triggerBody = tcreateTriggerSqlNode.Stmt.Stmt;
			return 0;
		}

		// Token: 0x170001DC RID: 476
		// (get) Token: 0x06000A3D RID: 2621 RVA: 0x00304B90 File Offset: 0x00302D90
		// (set) Token: 0x06000A3E RID: 2622 RVA: 0x00304B98 File Offset: 0x00302D98
		public virtual TObjectName TriggerName
		{
			get
			{
				return this.triggerName;
			}
			set
			{
				this.triggerName = value;
			}
		}

		// Token: 0x170001DD RID: 477
		// (get) Token: 0x06000A3F RID: 2623 RVA: 0x00304BA1 File Offset: 0x00302DA1
		// (set) Token: 0x06000A40 RID: 2624 RVA: 0x00304BA9 File Offset: 0x00302DA9
		public virtual TParseTreeNode EventClause
		{
			get
			{
				return this.eventClause;
			}
			set
			{
				this.eventClause = value;
			}
		}

		// Token: 0x170001DE RID: 478
		// (get) Token: 0x06000A41 RID: 2625 RVA: 0x00304BB2 File Offset: 0x00302DB2
		// (set) Token: 0x06000A42 RID: 2626 RVA: 0x00304BBA File Offset: 0x00302DBA
		public virtual TExpression WhenCondition
		{
			get
			{
				return this.whenCondition;
			}
			set
			{
				this.whenCondition = value;
			}
		}

		// Token: 0x170001DF RID: 479
		// (get) Token: 0x06000A43 RID: 2627 RVA: 0x00304BC3 File Offset: 0x00302DC3
		// (set) Token: 0x06000A44 RID: 2628 RVA: 0x00304BCB File Offset: 0x00302DCB
		public virtual TCustomSqlStatement TriggerBody
		{
			get
			{
				return this.triggerBody;
			}
			set
			{
				this.triggerBody = value;
			}
		}

		// Token: 0x170001E0 RID: 480
		// (get) Token: 0x06000A45 RID: 2629 RVA: 0x00304BD4 File Offset: 0x00302DD4
		// (set) Token: 0x06000A46 RID: 2630 RVA: 0x00304BDC File Offset: 0x00302DDC
		public virtual TObjectNameList FollowsTriggerList
		{
			get
			{
				return this.followsTriggerList;
			}
			set
			{
				this.followsTriggerList = value;
			}
		}

		// Token: 0x06000A47 RID: 2631 RVA: 0x00304BE5 File Offset: 0x00302DE5
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000A48 RID: 2632 RVA: 0x00304BF8 File Offset: 0x00302DF8
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.eventClause.acceptChildren(v);
			if (this.followsTriggerList != null)
			{
				this.followsTriggerList.acceptChildren(v);
			}
			if (this.whenCondition != null)
			{
				this.whenCondition.acceptChildren(v);
			}
			this.triggerBody.acceptChildren(v);
			v.postVisit(this);
		}

		// Token: 0x04001277 RID: 4727
		private TObjectName triggerName;

		// Token: 0x04001278 RID: 4728
		private TParseTreeNode eventClause;

		// Token: 0x04001279 RID: 4729
		private TExpression whenCondition;

		// Token: 0x0400127A RID: 4730
		private TCustomSqlStatement triggerBody;

		// Token: 0x0400127B RID: 4731
		private TObjectNameList followsTriggerList;
	}
}
